package com.dadaguai.service;

import com.dadaguai.common.BusinessException;
import com.dadaguai.common.R;
import com.dadaguai.domain.EmailCode;
import com.baomidou.mybatisplus.extension.service.IService;

/**
* @author 王半仙
* @description 针对表【email_code(邮箱验证码)】的数据库操作Service
* @createDate 2023-10-20 11:28:40
*/
public interface EmailCodeService extends IService<EmailCode> {

    /**
     * 发送邮箱验证码
     * @param email
     * @param type 0-注册；1-修改密码
     * @return true-发送成功
     */
    Boolean sendEmailCode(String email,Integer type) throws BusinessException;

    /**
     * 验证码校验
     * @param code
     * @param type 0=图片验证码；1=邮箱验证码
     * @param email
     * @return
     */
    R checkCode(String code, Integer type, String email);

    /**
     * 查询邮箱是否注册
     * @param email
     * @return
     */
    Integer queryEmailRegister(String email);
}
